package com.csust.travel.mapper;

import com.csust.travel.entity.TransactionComment;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface TransactionCommentMapper {



    @Select("select * from transactions_comment")
    List<TransactionComment> findAllItem();

    @Select("select * from transactions_comment where rating = #{string} or buyer_id =#{string} or seller_id =#{string}")
    List<TransactionComment> findByString(String queryString);

    @Delete("delete from transactions_comment where id = #{id}")
    void delItem(Integer id);

    @Select("select buyer_id from transactions_comment where id = #{id}")
    Integer findOne(Integer id);

    @Select("select seller_id from transactions_comment where id = #{id}")
    Integer findTwo(Integer id);

    @Select("select transaction_id from transactions_comment where id = #{id}")
    Integer findThree(Integer id);

    @Select("select rating from transactions_comment where id = #{id}")
    String findFour(Integer id);

    @Select("select comment from transactions_comment where id = #{id}")
    String findFive(Integer id);

    @Select("select comment_date from transactions_comment where id = #{id}")
    String findSix(Integer id);

    @Select("select books_id from transactions where id = #{id}")
    Integer findSeven(Integer id);

    @Select("select name from books where id = #{id}")
    String findEight(Integer id);
}
